﻿using System.Collections.Generic;

public class UiConfig
{
    //视图id
    public int viewId;
    //prefab存放路径
    public string pathFileName;
    //视图层
    public int layerType;
    //是否为大型的UI层，比如最底层UI，不销毁，隐藏，用于提升UI性能
    public bool isLarge;

    public List<int> closeLayerList = new List<int>();

    /// <summary>
    /// 设置
    /// </summary>
    /// <param name="viewId"></param>
    /// <param name="pathFileName"></param>
    /// <param name="layerType"></param>
    /// <param name="isLarget"></param>
    /// <param name="closeLayerArray"></param>
    public UiConfig(int viewId, string pathFileName, int layerType, bool isLarget = false,int [] closeLayerArray=null)
    {
        this.viewId = viewId;
        this.pathFileName = pathFileName;
        this.layerType = layerType;
        this.isLarge = isLarge;

        if (closeLayerArray!=null)
        {
            closeLayerList.AddRange(closeLayerArray);
        }else
        {
            if (layerType==UiConfigManger.System)
            {
                closeLayerList.Add(UiConfigManger.System);
            }
        }
    }
}
